// 评论相关的接口
import request from '@/utils/request'

// 获取文章评论列表
export const getAllComment = (obj) => {
  return request({
    method: 'GET',
    url: '/v1_0/comments',
    params: obj,
  })
}

// 增加文章评论
export const addComment = (obj) => {
  return request({
    method: 'POST',
    url: '/v1_0/comments',
    data: obj,
  })
}

// 点赞
export const LikeComment = (target) => {
  return request({
    method: 'POST',
    url: '/v1_0/comment/likings',
    data: {
      target,
    },
  })
}

// 取消点赞
export const UnLikeComment = (target) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/comment/likings/${target}`,
  })
}
